package com.bite.product.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RefreshScope
@RequestMapping("/config")
@RestController
public class NacosController {
    @Value("${nacos.test.num}")
    public String nacosConfig;
//@Value注解用来获取配置文件的内容
    @Value("${spring.application.name}")
    public String projectName;
    @Value("${server.port}")
    public String port;
    @RequestMapping("getConfig")
    public String getNacosConfig() {
        return nacosConfig + projectName + port;
    }
}
